function createXMLHTTP()
{
    var xmlhttp ;
    if (window.XMLHttpRequest)
    {   // IE7, FF, GC, O, S
        xmlhttp = new XMLHttpRequest();
    }
    else
    {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xmlhttp;
}

function ajaxLontong(div, url)
{
    xmlhttp = createXMLHTTP();
    if (xmlhttp.readtState == 4 && xmlhttp.status == 200)
    {
        document.getElementById(div).innerHTML = xmlhttp.responseText;
    }
    xmlhttp.open("GET",url, true);
    xmlhttp.send();
}

function showProfile(nameviewed)
{
    var xmlhttp = createXMLHTTP();
    var url = "content/profile_content.php?ajax=true&name_viewed="+nameviewed;
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4)
        {
            document.getElementById("content").innerHTML =xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url, true);
    xmlhttp.send();
}
function showHome(nameviewed)
{
    var xmlhttp = createXMLHTTP();
    var url = "content/home_content.php?ajax=true&name_viewed="+nameviewed;
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4)
        {
            document.getElementById("content").innerHTML =xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url, true);
    xmlhttp.send();
}
function showFotoAlbum(nameviewed)
{
    var xmlhttp = createXMLHTTP();
    var url = "content/fotoalbum_content.php?ajax=true&name_viewed="+nameviewed;
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4)
        {
            document.getElementById("content").innerHTML =xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url, true);
    xmlhttp.send();
}

function showWall(nameviewed)
{
    var xmlhttp = createXMLHTTP();
    var url = "content/wall_content.php?ajax=true&name_viewed="+nameviewed;
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4)
        {
            document.getElementById("content").innerHTML =xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url, true);
    xmlhttp.send();
}

function showMessages(nameviewed)
{
    var xmlhttp = createXMLHTTP();
    var url = "content/message_content.php?ajax=true&name_viewed="+nameviewed;
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4)
        {
            document.getElementById("content").innerHTML =xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url, true);
    xmlhttp.send();
}

function showMessagesOnPage(nameviewed,page)
{
    var xmlhttp = createXMLHTTP();
    var url = "content/message_content.php?ajax=true&name_viewed="+nameviewed+"&page="+page;
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4)
        {
            document.getElementById("content").innerHTML =xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET",url, true);
    xmlhttp.send();
}